#ifndef  __PUBLICHEAD_HH__
#define __PUBLICHEAD_HH__

#include "targetver.h"

#include <boost/array.hpp>
#include <boost/asio.hpp>
#include <boost/thread.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/foreach.hpp>
#include <boost/bind.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/enable_shared_from_this.hpp>

#include <vector>
#include <map>

#include "LogModule.h"
#include "INetInterface.h"

class NetIDGenerator
{
public:
	NetIDGenerator( void ){ InitializeCriticalSection(&cs); }

	~NetIDGenerator( void ){ DeleteCriticalSection(&cs); }

	unsigned __int64 get_id( void )
	{
		static unsigned __int64 i = 1;
		EnterCriticalSection(&cs);
		i++;
		LeaveCriticalSection(&cs);
		return i;
	}

private:
	CRITICAL_SECTION cs;
};

#endif